package com.zilu.digitaltwin.dto.resp;

import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;

/**
 * @Author :heguangyao
 * @Description :实体详情信息
 * @Date :2023/1/8 14:36
 **/
@Data
public class EntityBasicInfoDataQRespDTO {
    @JSONField(name = "building_name")
    private String name;

    @JSONField(name = "building_address")
    private String locationDesc;

    private String town;
    private String community;
    @JSONField(name = "grid_name")
    private String grid;
    @JSONField(name = "building_id")
    private String buildingId;

    public String getName() {
        if (null != this.name && !this.name.trim().isEmpty()) {
            int lastIndex = this.name.lastIndexOf("社区");
            if (lastIndex > 0) {
                return name.substring(lastIndex + 2);
            }

        }
        return this.name;
    }

}
